import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Classroom {
    private String className;
    private List<Student> students;

    public Classroom(String className) {
        this.className = className;
        this.students = new ArrayList<>();
    }

    public void addStudent(Student student) {
        students.add(student);
    }

    public String getClassName() {
        return className;
    }

    public List<Student> getStudents() {
        return students;
    }

    // 随机选择一个学生  
    public Student getRandomStudent() {
        Random random = new Random();
        int index = random.nextInt(students.size());
        return students.get(index);
    }

    @Override
    public String toString() {
        return "Classroom{" +
                "className='" + className + '\'' +
                ", students=" + students +
                '}';
    }
}